/*************************************************************************
	> File Name: test13.cc
	> Author: H.M. Lau
	> Mail: hm.lau@outlook.com
	> Created Time: 2023/09/21 13:28
 ************************************************************************/

#include <iostream>
#include <signal.h>

int main(int argc, char *argv[])
{
    signal(SIGCHLD, SIG_IGN);
    if (fork() == 0) {
        std::cout << "Child:" << getpid() << std::endl;
        sleep(10);
        exit(0);
    }
    while (1) {
        std::cout << "Father:" << getpid() << " execute my tasks." << std::endl;
        sleep(1);
    }
    return 0;
}
